#!/bin/bash

# postinst script for developer-build-onbld
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
	chmod 0555 "$BASEDIR/opt/onbld/bin/Install"
	chown root:bin "$BASEDIR/opt/onbld/bin/Install"
	chmod 0555 "$BASEDIR/opt/onbld/bin/bldenv"
	chown root:bin "$BASEDIR/opt/onbld/bin/bldenv"
	chmod 0555 "$BASEDIR/opt/onbld/bin/build_cscope"
	chown root:bin "$BASEDIR/opt/onbld/bin/build_cscope"
	chmod 0555 "$BASEDIR/opt/onbld/bin/cddlchk"
	chown root:bin "$BASEDIR/opt/onbld/bin/cddlchk"
	chmod 0555 "$BASEDIR/opt/onbld/bin/check_rtime"
	chown root:bin "$BASEDIR/opt/onbld/bin/check_rtime"
	chmod 0555 "$BASEDIR/opt/onbld/bin/checkpaths"
	chown root:bin "$BASEDIR/opt/onbld/bin/checkpaths"
	chmod 0555 "$BASEDIR/opt/onbld/bin/copyrightchk"
	chown root:bin "$BASEDIR/opt/onbld/bin/copyrightchk"
	chmod 0555 "$BASEDIR/opt/onbld/bin/cstyle"
	chown root:bin "$BASEDIR/opt/onbld/bin/cstyle"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfconvert"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfconvert"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfdiff"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfdiff"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfdump"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfdump"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfmerge"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfmerge"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfstabs"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfstabs"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ctfstrip"
	chown root:bin "$BASEDIR/opt/onbld/bin/ctfstrip"
	chmod 0555 "$BASEDIR/opt/onbld/bin/elfcmp"
	chown root:bin "$BASEDIR/opt/onbld/bin/elfcmp"
	chmod 0555 "$BASEDIR/opt/onbld/bin/elfextract"
	chown root:bin "$BASEDIR/opt/onbld/bin/elfextract"
	chmod 0555 "$BASEDIR/opt/onbld/bin/findcrypto"
	chown root:bin "$BASEDIR/opt/onbld/bin/findcrypto"
	chmod 0555 "$BASEDIR/opt/onbld/bin/flg.flp"
	chown root:bin "$BASEDIR/opt/onbld/bin/flg.flp"
	chmod 0555 "$BASEDIR/opt/onbld/bin/genoffsets"
	chown root:bin "$BASEDIR/opt/onbld/bin/genoffsets"
	chmod 0555 "$BASEDIR/opt/onbld/bin/git-pbchk"
	chown root:bin "$BASEDIR/opt/onbld/bin/git-pbchk"
	chmod 0555 "$BASEDIR/opt/onbld/bin/hdrchk"
	chown root:bin "$BASEDIR/opt/onbld/bin/hdrchk"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/cw"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/cw"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/find_elf"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/find_elf"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/findunref"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/findunref"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/lintdump"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/lintdump"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/protocmp"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/protocmp"
	chmod 0555 "$BASEDIR/opt/onbld/bin/i386/protolist"
	chown root:bin "$BASEDIR/opt/onbld/bin/i386/protolist"
	chmod 0555 "$BASEDIR/opt/onbld/bin/interface_check"
	chown root:bin "$BASEDIR/opt/onbld/bin/interface_check"
	chmod 0555 "$BASEDIR/opt/onbld/bin/interface_cmp"
	chown root:bin "$BASEDIR/opt/onbld/bin/interface_cmp"
	chmod 0555 "$BASEDIR/opt/onbld/bin/jstyle"
	chown root:bin "$BASEDIR/opt/onbld/bin/jstyle"
	chmod 0555 "$BASEDIR/opt/onbld/bin/mapfilechk"
	chown root:bin "$BASEDIR/opt/onbld/bin/mapfilechk"
	chmod 0555 "$BASEDIR/opt/onbld/bin/mbh_patch"
	chown root:bin "$BASEDIR/opt/onbld/bin/mbh_patch"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ndrgen"
	chown root:bin "$BASEDIR/opt/onbld/bin/ndrgen"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ndrgen1"
	chown root:bin "$BASEDIR/opt/onbld/bin/ndrgen1"
	chmod 0555 "$BASEDIR/opt/onbld/bin/nightly"
	chown root:bin "$BASEDIR/opt/onbld/bin/nightly"
	chmod 0555 "$BASEDIR/opt/onbld/bin/onu"
	chown root:bin "$BASEDIR/opt/onbld/bin/onu"
	chmod 0555 "$BASEDIR/opt/onbld/bin/protocmp.terse"
	chown root:bin "$BASEDIR/opt/onbld/bin/protocmp.terse"
	chmod 0555 "$BASEDIR/opt/onbld/bin/signit"
	chown root:bin "$BASEDIR/opt/onbld/bin/signit"
	chmod 0555 "$BASEDIR/opt/onbld/bin/signproto"
	chown root:bin "$BASEDIR/opt/onbld/bin/signproto"
	chmod 0555 "$BASEDIR/opt/onbld/bin/validate_flg"
	chown root:bin "$BASEDIR/opt/onbld/bin/validate_flg"
	chmod 0555 "$BASEDIR/opt/onbld/bin/validate_paths"
	chown root:bin "$BASEDIR/opt/onbld/bin/validate_paths"
	chmod 0555 "$BASEDIR/opt/onbld/bin/validate_pkg"
	chown root:bin "$BASEDIR/opt/onbld/bin/validate_pkg"
	chmod 0555 "$BASEDIR/opt/onbld/bin/wdiff"
	chown root:bin "$BASEDIR/opt/onbld/bin/wdiff"
	chmod 0555 "$BASEDIR/opt/onbld/bin/webrev"
	chown root:bin "$BASEDIR/opt/onbld/bin/webrev"
	chmod 0555 "$BASEDIR/opt/onbld/bin/which_scm"
	chown root:bin "$BASEDIR/opt/onbld/bin/which_scm"
	chmod 0555 "$BASEDIR/opt/onbld/bin/ws"
	chown root:bin "$BASEDIR/opt/onbld/bin/ws"
	chmod 0555 "$BASEDIR/opt/onbld/bin/wscheck"
	chown root:bin "$BASEDIR/opt/onbld/bin/wscheck"
	chmod 0555 "$BASEDIR/opt/onbld/bin/wsdiff"
	chown root:bin "$BASEDIR/opt/onbld/bin/wsdiff"
	chmod 0555 "$BASEDIR/opt/onbld/bin/xref"
	chown root:bin "$BASEDIR/opt/onbld/bin/xref"
	chmod 0555 "$BASEDIR/opt/onbld/lib/i386/libctf.so.1"
	chown root:bin "$BASEDIR/opt/onbld/lib/i386/libctf.so.1"
	chmod 0644 "$BASEDIR/opt/onbld/bin/xref.mk"
	chown root:bin "$BASEDIR/opt/onbld/bin/xref.mk"
	chmod 0644 "$BASEDIR/opt/onbld/env/illumos"
	chown root:bin "$BASEDIR/opt/onbld/env/illumos"
	chmod 0644 "$BASEDIR/opt/onbld/etc/exception_lists/check_rtime"
	chown root:bin "$BASEDIR/opt/onbld/etc/exception_lists/check_rtime"
	chmod 0644 "$BASEDIR/opt/onbld/etc/exception_lists/interface_check"
	chown root:bin "$BASEDIR/opt/onbld/etc/exception_lists/interface_check"
	chmod 0644 "$BASEDIR/opt/onbld/etc/exception_lists/interface_cmp"
	chown root:bin "$BASEDIR/opt/onbld/etc/exception_lists/interface_cmp"
	chmod 0644 "$BASEDIR/opt/onbld/etc/its.conf"
	chown root:bin "$BASEDIR/opt/onbld/etc/its.conf"
	chmod 0644 "$BASEDIR/opt/onbld/etc/its.reg"
	chown root:bin "$BASEDIR/opt/onbld/etc/its.reg"
	chmod 0644 "$BASEDIR/opt/onbld/lib/perl/onbld_elfmod.pm"
	chown root:bin "$BASEDIR/opt/onbld/lib/perl/onbld_elfmod.pm"
	chmod 0644 "$BASEDIR/opt/onbld/lib/perl/onbld_elfmod_vertype.pm"
	chown root:bin "$BASEDIR/opt/onbld/lib/perl/onbld_elfmod_vertype.pm"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/Install.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/Install.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/bldenv.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/bldenv.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/btxld.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/btxld.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/cddlchk.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/cddlchk.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/check_rtime.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/check_rtime.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/checkpaths.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/checkpaths.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/cstyle.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/cstyle.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/ctfconvert.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/ctfconvert.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/cw.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/cw.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/find_elf.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/find_elf.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/findunref.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/findunref.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/flg.flp.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/flg.flp.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/git-pbchk.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/git-pbchk.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/hdrchk.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/hdrchk.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/interface_check.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/interface_check.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/interface_cmp.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/interface_cmp.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/jstyle.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/jstyle.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/lintdump.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/lintdump.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/mapfilechk.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/mapfilechk.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/ndrgen.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/ndrgen.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/nightly.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/nightly.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/onu.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/onu.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/signit.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/signit.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/signproto.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/signproto.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/webrev.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/webrev.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/which_scm.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/which_scm.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/ws.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/ws.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/wsdiff.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/wsdiff.1onbld"
	chmod 0644 "$BASEDIR/opt/onbld/man/man1onbld/xref.1onbld"
	chown root:bin "$BASEDIR/opt/onbld/man/man1onbld/xref.1onbld"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

